/**
 * 
 */
package com.google.code.netz.wfe.events;

import com.google.code.netz.wfe.model.Activity;

/**
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @since 1.0
 * @version $Id: ActivityEvent.java 17 2009-02-09 13:08:49Z rahul.thakur.xdev $
 */
public class ActivityEvent<T extends Activity> extends TypedEvent<T> {

	public enum EventType implements IEventType {

		/**
		 * Implies that an Activity has started.
		 */
		ACTIVITY_OPENED("Activity Opened"),

		/**
		 * Implies that an active Activity is now suspended.
		 */
		ACTIVITY_SUSPENDED("Activity Suspended"),

		/**
		 * Implies that an Activity has terminated.
		 */
		ACTIVITY_CLOSED("Activty Closed");

		/**
		 * Event type expressed as String.
		 */
		private String type;

		/**
		 * @param type
		 */
		private EventType(String type) {
			this.type = type;
		}

		/**
		 * {@inheritDoc}
		 * 
		 * @see com.google.code.netz.wfe.events.IEventType#asString()
		 */
		@Override
		public String asString() {
			return type;
		}

		/**
		 * {@inheritDoc}
		 * 
		 * @see com.google.code.netz.wfe.events.IEventType#allEventTypes()
		 */
		@Override
		public IEventType[] allEventTypes() {
			return values();
		}

	}

	public ActivityEvent(T source, IEventType type) {
		super(source, type);
	}

}
